package com.stt.experiment.websocket.action.dispatcher;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

@Component
public class ActionConfig {

    @Value("${dispatcher.corePoolSize}")
    private int corePoolSize = 1;
    @Value("${dispatcher.maximumPoolSize}")
    private int maximumPoolSize = 3;
    @Value("${dispatcher.keepAliveTime}")
    private int keepAliveTime = 10;
    @Value("${dispatcher.timeUnit}")
    private TimeUnit timeUnit;

    public ActionConfig() {
        this.timeUnit = TimeUnit.MINUTES;
    }

    public int getCorePoolSize() {
        return this.corePoolSize;
    }

    public void setCorePoolSize(int corePoolSize) {
        this.corePoolSize = corePoolSize;
    }

    public int getMaximumPoolSize() {
        return this.maximumPoolSize;
    }

    public void setMaximumPoolSize(int maximumPoolSize) {
        this.maximumPoolSize = maximumPoolSize;
    }

    public int getKeepAliveTime() {
        return this.keepAliveTime;
    }

    public void setKeepAliveTime(int keepAliveTime) {
        this.keepAliveTime = keepAliveTime;
    }

    public TimeUnit getTimeUnit() {
        return this.timeUnit;
    }

    public void setTimeUnit(TimeUnit timeUnit) {
        this.timeUnit = timeUnit;
    }
}
